package cn.tedu.anjiadb.mapper;


import cn.tedu.anjiadb.pojo.entity.User;
import cn.tedu.anjiadb.pojo.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper {
    int insert(User user);

    int insert(List<User> userList);

    int deleteById(Long id);

    int deleteByIds(Long[] idList);

    int update(User user);

    int count();

    int countByPhoneNum(Long phoneNum);

    int countByName(String name);

    int countByNameAndNotId(@Param("id") Long id, @Param("username") String name);

    int countByNickName(String name);

    int countByNickNameAndNotId(@Param("id") Long id, @Param("nickname") String name);

    UserStandardVO getStandardById(Long id);

    UserLoginInfoVO getLoginInfoByUsername(String username);

    List<UserListItemVO> list();

    List<ProductListItemVO> getProductListById(Long userId);
}
